<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta content="black" name="apple-mobile-web-app-status-bar-style">
		<meta content="telephone=no" name="format-detection">
		<meta name="viewport" content="width=device-width">
		<link rel="stylesheet" href="../assets/css/index.css">
		<link rel="stylesheet" href="../assets/css/wStyle.css" />
		<link rel="stylesheet" href="../assets/css/wvStyle.css" />

		<script type="text/javascript" src="../assets/js/jquery-3.1.0.min.js"></script>
		<script type="text/javascript" src="../assets/js/layer.js"></script>
		<script type="text/javascript" src="../js/config.js"></script>
		<title>首页</title>
		<style type="text/css">
			.header2 div.right p {
				float: left;
				margin: 2px 10px;
			}
			
			.content {
				margin-top: 0;
			}
			
			input[type=text],
			input[type=password] {
				border-color: #bbb;
				height: 38px;
				font-size: 14px;
				border-radius: 2px;
				outline: 0;
				border: #ccc 1px solid;
				padding: 0 10px;
				width: 250px;
				-webkit-transition: box-shadow .5s;
				margin-bottom: 15px;
			}
			
			input[type=text]:hover,
			input[type=text]:focus,
			input[type=password]:hover,
			input[type=password]:focus {
				border: 1px solid #56b4ef;
				box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 0 8px rgba(82, 168, 236, .6);
				-webkit-transition: box-shadow .5s;
			}
			
			input::-webkit-input-placeholder {
				color: #999;
				-webkit-transition: color .5s;
			}
			
			input:focus::-webkit-input-placeholder,
			input:hover::-webkit-input-placeholder {
				color: #c2c2c2;
				-webkit-transition: color .5s;
			}
			
			.layui-layer-page .layui-layer-content {
				text-align: center;
				margin-top: 20px;
			}
			
			.layui-layer-title {
				text-align: center;
				padding: 0;
			}
		</style>
	</head>

	<body>
		<div class="header2">
			<div class="left">
				<img src="../assets/i/logo.png" />
			</div>
			<div class="right">
				<!--<p><img src="../assets/i/phone.png" style="width: 20px;height: 20px; border-radius: 0;">400-888-8888</p>-->
				<p><img src="../assets/i/zx.png" style="width: 100%;height: 100%; border-radius: 0"></p>
				<!--<p>English</p>-->
				<div class="clear"></div>
			</div>
			<div class="clear"></div>
		</div>
		<div class="content">
			<div class="pager">
				<div class="w720">
					<a><img src="../assets/i/shenqing.png"></a>
				</div>
				<div class="w360" style="background: #f0c239;">
					<a><img src="../assets/i/yuyue.png" /></a>
				</div>
				<div class="w360" style="background: #4fc72f;">
					<a><img src="../assets/i/tijiao.png" /></a>
				</div>
				<div style="background: #914eff;">
					<a id="toshow" herf="#"><img src="../assets/i/yisheng.png"></a>
				</div>
				<div style="background: #3d98ff;">
					<a><img src="../assets/i/zixun.png" /></a>
				</div>
				<div style="background: #fc9720;">
					<a><img src="../assets/i/zhengche.png" /></a>
				</div>
			</div>
			<div class="message-div">
				<div class="zc">
					<div class="head">
						<span class="title">最新政策</span>
						<span class="more">更多>></span>
						<div class="clear"></div>
					</div>
					<p>正规假肢安装法律规定</p>
					<p>赔偿安装的假肢、矫形器等辅助器...</p>
					<p>无手男童获得炫酷六一礼物 3D打...</p>
					<p>3D打印义肢可不是技术加物流这么...</p>
				</div>
				<div class="public">
					<div class="head">
						<span class="title">通知公告</span>
						<span class="more">更多>></span>
						<div class="clear"></div>
					</div>
					<p>大渡口残联每人免费安装义肢一次</p>
					<p>义肢3年到期请预约专家测量尺寸</p>
					<p>国产假肢与矫形器的使用寿命，按...</p>
					<p>3D打印的钢铁侠义肢:圆小孩的英雄梦</p>
				</div>
				<div class="clear"></div>
			</div>
		</div>
		<div id="login" style="display: none;">
			<input type="text" placeholder="用户名" name="username" />
		</div>
		<footer>
			<a>联系我们</a>
			<a>网站地图</a>
		</footer>
	</body>
	<script type="text/javascript">
		var type = '', userCode = '', sessionId='';

		function openWindow() {
			//自定页
			layer.open({
				type: 1,
				title: '登录',
				closeBtn: 0, //不显示关闭按钮
				shift: 2,
				area: ['420px', '125px'], //宽高
				shadeClose: false, //开启遮罩关闭
				content: $('#login').html()
			});
		}

		$(document).ready(function() {
			openWindow();
		});

		//按下回车键时的响应
		document.onkeydown = function(event) {
			var e = event || window.event || arguments.callee.caller.arguments[0];
			if(e && e.keyCode == 13) { // enter 键
				login();
			}
		};

		function login() {
			var val = $('.layui-layer-content input').val();
			console.log(val)

			if(val == null || val == '') {
				layer.msg('用户名不能为空！');
				return false;
			}

			$.ajax({
				type: "get",
				url: "/login?userName=" + val,
				async: false,
				success: function(data) {
					if(!data) {
						layer.msg('用户不存在！');
						return false;
					}
					type = data.type;
					userCode = data.userCode;
					sessionId = data.sessionId;
					layer.closeAll();
				}
			});
		};

		$('#toshow').on('click', function() {
			if(type == 1) {
				location.href = "video.html?userCode=" + userCode+"&sessionId="+sessionId;
			} else {
				location.href = "dselect.html?userCode=" + userCode+"&sessionId="+sessionId;
			}
		});
	</script>

</html>